package com.masterclient.app.modules.cart.holder;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.masterclient.app.R;
import com.masterclient.app.modules.cart.adapter.ShopCartAdapterListener;

public class NullViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

    private TextView tvGotoSee;
    private ShopCartAdapterListener mListener;

    public NullViewHolder(ViewGroup itemView, ShopCartAdapterListener listener) {
        super(LayoutInflater.from(itemView.getContext()).inflate(R.layout.view_null_cart,itemView,false));
        mListener = listener;
        tvGotoSee = this.itemView.findViewById(R.id.tvGotoSee);
    }

    public void onBindViewHolder(){
        tvGotoSee.setOnClickListener(this::onClick);
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.tvGotoSee){
            mListener.onGoIntoMain();
        }
    }
}
